package tv.geir.slackspace.server;

import java.io.IOException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import tv.geir.slackspace.common.BeanConfig;
import tv.geir.slackspace.common.BeanFactory;

public class Server {

	private final String version = "0.1";
	
	private ServerConnector serverConnector;
	
	
	
	private static Log log = LogFactory.getLog( Server.class );
	
	public void stop() {
		if (log.isDebugEnabled()) {
			log.debug("stop()");
		}

		serverConnector.stopConnector();
	}
	
	public Server() {
		
		
	
		 
	}
	
	public void init() {
		if( log.isInfoEnabled() ) {
			log.info( "SlackSpaces " + version + " started");
		}
	}
	
	
	public static void main(String[] args) throws IOException {
		
		// start sever
		BeanFactory.getServerBean( BeanConfig.SLACKSPACE_SERVER );
		//System.in.read();
		//s.stop();
		
	}

	public ServerConnector getServerConnector() {
		return serverConnector;
	}

	public void setServerConnector(ServerConnector serverConnector) {
		this.serverConnector = serverConnector;
	}


}
